# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

# Initial PKGBUILD from AUR.
# Old Maintainer: SteamedFish <steamedfish@hotmail.com>
# Old Contributor: nemanjan00 <nemanjan00@gmail.com>

pkgname=dsd-fme
pkgver=2024
pkgrel=1
pkgdesc='Digital Speech Decoder - Florida Man Edition.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-misc')
url='https://github.com/lwvmobile/dsd-fme'
license=('custom:copyright')
install="$pkgname.install"
depends=('libpulse' 'ncurses' 'rtl-sdr' 'fftw' 'codec2' 'libsndfile' 'itpp' 'xz'
         'mbelib' 'glibc' 'gcc-libs' 'libogg' 'libvorbis' 'flac' 'lapack' 'opus'
         'mpg123' 'lame' 'blas' 'libusb' 'dbus' 'libxcb' 'systemd-libs' 'zstd'
         'libasyncns' 'libxau' 'libxdmcp' 'libcap' 'lz4' 'libgpg-error')
optdepends=('pulseaudio: use pulse as audio input device')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::https://github.com/lwvmobile/$pkgname/archive/refs/tags/$pkgver.tar.gz")
sha512sums=('454d14ef3c4fe926b055a14d4071d489200a2fc122f433668e838a4951fe1dbb1f5f2059dc32381da546e299d23caec55e2b6bf50ad0724c1f7314c1bf45632a')

build() {
  cmake -B build -S "$srcdir/$pkgname-$pkgver" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -Wno-dev

  make -C build
}

package() {
  make -C build DESTDIR="$pkgdir/" install

  cd "$srcdir/$pkgname-$pkgver"

  install -Dm 644 COPYRIGHT "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT"
  install -Dm 644 README.md "$pkgdir/usr/share/doc/$pkgname/$pkgname.txt"
}

